package com.scoresystem.dao.proxy;

import java.sql.Connection;
import java.util.List;

import com.scoresystem.dao.IRemarkDao;
import com.scoresystem.dao.impl.RemarkDaoImpl;
import com.scoresystem.model.StuRemark;
import com.scoresystem.utils.JdbcUtil;

public class RemarkDaoProxy implements IRemarkDao {
	private IRemarkDao dao=null;
	private Connection conn=null;
	public RemarkDaoProxy()throws Exception{
		conn=JdbcUtil.getInstance().getConnection();
		dao=new RemarkDaoImpl(conn);
	}
	@Override
	public boolean add(String stunum, String worknum, String remark) {
		boolean bool=dao.add(stunum, worknum, remark);
		JdbcUtil.getInstance().free(conn);
		return bool;
	}
	@Override
	public boolean modify(String stunum, String worknum, String remark) {
		boolean bool=dao.modify(stunum, worknum, remark);
		JdbcUtil.getInstance().free(conn);
		return bool;
	}
	@Override
	public List<StuRemark> listAll(String worknum) {
		List<StuRemark> list=dao.listAll(worknum);
		JdbcUtil.getInstance().free(conn);
		return list;
	}

}
